<%--数据字典--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!-- 导入头部top文件 start -->
<%@include file="../common/header.jsp" %>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-title">
                    <h5>候选人列表</h5>
                </div>

                <div class="ibox-content">
                    <div class="fr btn-group">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"
                                style="background-color: #fff;color:black">
                            全部状态 <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                            <li role="presentation"><a role="menuitem" tabindex="-1"
                                                       href="javascript:search(1)">未读</a>
                            </li>
                            <li role="presentation"><a role="menuitem" tabindex="-1" href="javascript:search(2)">面试</a>
                            </li>
                            <li role="presentation"><a role="menuitem" tabindex="-1"
                                                       href="javascript:search(3)">待录用</a>
                            </li>
                            <li role="presentation"><a role="menuitem" tabindex="-1"
                                                       href="javascript:search(4)">待入职</a>
                            </li>
                            <li role="presentation"><a role="menuitem" tabindex="-1"
                                                       href="javascript:search(5)">废弃</a>
                            </li>
                        </ul>
                    </div>
                    <div class="list-view" id="listview">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.5"></script>
<script src="/static/js/content.min.js?v=1.0.0"></script>
<script src="/static/js/listview.js?v=1.0.0"></script>
<script src="/static/js/plugins/dialog/dialog-min.js?v=1.0.0"></script>
<script src="/static/js/plugins/dialog/dialog-plus-min.js?v=1.0.0"></script>
<script src="/static/js/cateDialog.js"></script>
<script>
    var lv;
    (function () {
        lv = $("#listview").listview({
            url: "/job/resume/inbox/json",
            editUrl: "/job/resume/inbox/edit",
            deleteUrl: "/job/resume/inbox/delete",
            viewUrl: "/job/resume/inbox/view",
            showTools: true,
            editStatus: false,
            showView: true,
            showDelete: true,
            buttonLoad: function (id) {
                var self = this;
                var model = self.data[id];
                var obj = {};
                if (model.status >= 2) {
                    obj["面试"] = false;
                } else {
                    obj["面试"] = true;
                }
                if (model.status >= 3) {
                    obj["待录用"] = false;
                } else {
                    obj["待录用"] = true;
                }
                if (model.status >= 4) {
                    obj["待入职"] = false;
                } else {
                    obj["待入职"] = true;
                }
                if (model.status == 5) {
                    obj["废弃"] = false;
                } else {
                    obj["废弃"] = true;
                }
                return obj;
            },
            buttons: {
                "面试": function (item, id) {
                    update(item, id, 2);
                },
                "待录用": function (item, id) {
                    update(item, id, 3);
                },
                "待入职": function (item, id) {
                    update(item, id, 4);
                },
                "废弃": function (item, id) {
                    update(item, id, 5);
                }
            },
            fieldInfo: [
                {"field": "no", "title": "序号"},
                {"field": "resumeName", "title": "姓名"},
                {"field": "jobName", "title": "职位名称"},
                {
                    "field": "status",
                    "title": "投递状态",
                    type: "data",
                    data: {1: "未读", 2: "面试", 3: "待录用", 4: "待入职", 5: "废弃"}
                },//投递状态 1 未读 2 面试 3 待录用 4 待入职  5 废弃
                {"field": "createDate", "title": "投递时间"},
            ]
        });
    })(jQuery)
    function search(status) {
        var param = {};
        param.status = status;
        lv.search(param);
    }
    function update(item, id, status) {
        var url = "/job/resume/inbox/status?id=" + id + "&status=" + status;
        $.get(url, function (text) {
            lv.get();
        })
    }
</script>
</body>
</html>
